import org.springframework.beans.factory.BeanFactory;
import org.springframework.beans.factory.xml.XmlBeanFactory;
import org.springframework.core.io.ClassPathResource;

public class TestMain {
    public static void main(String[] args) {
        BeanFactory context =  new XmlBeanFactory(new ClassPathResource("spring-config.xml"));
        System.out.println("BeanFactory加载getBean()前!!!");
        User user = context.getBean("user",User.class);
        System.out.println(user.greet());
        User2 user2 = context.getBean("user2",User2.class);
        System.out.println(user2.greet());
    }
}
